<template>
	<view>

		<!-- 导航栏	 -->
		<view class="sl_nav">
			<view class="background" :style="{backgroundImage:'url('+details.coverImgUrl+')'} "></view>
			<!-- 返回箭头 -->
			<view class="sl_back" @click="slback">
				<image src="../../../static/fanhuijiantou2.png" mode=""></image>
			</view>
			<!-- 歌单 -->
			<view class="sl_gedan">
				<text>歌单</text>
			</view>
			<!-- 搜索图标 -->
			<view class="sl_sosou">
				<image src="../../../static/sousuo.png" mode=""></image>
			</view>
			<!-- 更多按钮 -->
			<view class="sl_gengduo">
				<image src="../../../static/gengduo1.png" mode=""></image>
			</view>
		</view>
		<!-- 详细信息 -->
		<view class="sl_detail">
			<!-- 歌单图片 -->
			<view class="sl_detail_image">
				<image :src="details.coverImgUrl" mode=""></image>
			</view>
			<!-- 歌单描述 -->
			<view class="sl_detail_text">
				<text>{{details.name}}</text>
			</view>
			<!-- 歌单作者 -->
			<view class="sl_detail_ar">
				<image :src="details.creator.avatarUrl"></image>
				<text>{{details.creator.nickname}}</text>
				<text class="sl_detail_al_text">{{details.description}}</text>
			</view>
		</view>
		<!-- 功能 -->
		<view class="sl_gn">
			<!-- 收藏 -->
			<view class="sl_sc">
				<!-- 图标 -->
				<image src="../../../static/souchang1.png"></image>
				<!-- 人数 -->
				<text>{{shu.bookedCount}}</text>
			</view>
			<!-- 评论 -->
			<view class="sl_pl">
				<!-- 图标 -->
				<image src="../../../static/pinglun1.png"></image>
				<!-- 人数 -->
				<text>{{shu.commentCount}}</text>
			</view>
			<!-- 人数 -->
			<!-- 分享 -->
			<view class="sl_fx">
				<!-- 图标 -->
				<image src="../../../static/fenxiang3.png"></image>
				<!-- 人数 -->
				<text>{{shu.shareCount}}</text>
			</view>
			<!-- 人数 -->
		</view>

		<!-- 主体部分 -->

		<!-- 功能部分 -->
		<!-- 图标 -->
		<!-- 播放全部 -->
		<!-- 全选 -->
		<view class="sl_all">
			<image class="sl_all_image1" src="../../../static/my_sort/bofang.png"></image>
			<text class="sl_all_text">播放全部</text>
			<image class="sl_all_image2" src="../../../static/quanxuan.png"></image>
		</view>
		<!-- 内容部分 -->
		<view class="sl_nr" v-for="(item,index) in details.trackIds" :key="item.id">
			<view>
				<text class="sl_nr_text1">{{item.id}}</text>
				<text class="sl_nr_text2"></text>
				<text class="sl_nr_text3"></text>
				<text class="sl_nr_text4"></text>
				<image class="sl_nr_image2" src="../../../static/bofang2.png"></image>
				<image class="sl_nr_image3" src="../../../static/found/gengduo.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				details: {},
				shu: [],

			}
		},


		onLoad() {


		},
		onShow() {
			this.myData = uni.getStorageSync('setData');
			this.getdetails(this.myData)
			this.getshu(this.myData)
			this.getgedansong(song);
			console.log(this.myData)
		},
		methods: {
			getdetails(myData) {
				uni.request({
					url: 'http://localhost:3000/playlist/detail',
					data: {
						id: myData
					},
					method: 'GET',
					success: (res) => {
						this.details = res.data.playlist
						console.log(res.data.playlist)

					}
				})
				
			},

			getshu(myData) {
				uni.request({
					url: 'http://localhost:3000/playlist/detail/dynamic',
					data: {
						id: myData
					},
					method: 'GET',
					success: (res) => {
						this.shu = res.data
					}
				})
			},
			getgedansong() {
				uni.request({
					url: 'http://localhost:3000/song/detail?ids=488256353',
					
					method: 'GET',
					success: (res) => {
						console.log(res.data)
					}
				})
			},
			slback() {
				uni.navigateBack({
					delta: 1
				})
				uni.removeStorage({
					key: 'myData',
					success: function() {
						console.log('删除成功')
					}
				})


			}
		}
	}
</script>

<style lang="scss">
	.sl_nav {
		width: 750rpx;
		height: 60rpx;
		margin-top: 30rpx;

		.sl_back {
			width: 50rpx;
			height: 50rpx;
			margin-top: 2rpx;
			margin-left: 20rpx;

			image {
				width: 50rpx;
				height: 50rpx;
				color: #fff;

			}
		}
	}

	.sl_gedan {
		text {
			position: absolute;
			top: 6rpx;
			left: 80rpx;
			font-weight: 600;
			color: #fff;
			font-size: 30rpx;
		}
	}

	.sl_sosou {
		image {
			width: 40rpx;
			height: 40rpx;
			position: absolute;
			top: 10rpx;
			right: 150rpx;
		}

	}

	.sl_gengduo {
		image {
			width: 60rpx;
			height: 60rpx;
			position: absolute;
			top: 0rpx;
			right: 50rpx;
		}
	}

	// 详细信息
	.sl_detail {
		width: 750rpx;
		height: 400rpx;
		position: relative;

		.sl_detail_image {
			image {
				width: 200rpx;
				height: 200rpx;
				position: absolute;
				top: 50rpx;
				left: 20rpx;
				border-radius: 10px;
			}

		}

		.sl_detail_text {
			text {
				width: 500rpx;
				height: 40rpx;
				position: absolute;
				top: 70rpx;
				left: 250rpx;
				color: #fff;
				overflow: hidden;
				word-break: break-all;
				/* break-all(允许在单词内换行。) */
				text-overflow: ellipsis;
				/* 超出部分省略号 */
				display: -webkit-box;
				/** 对象作为伸缩盒子模型显示 **/
				-webkit-box-orient: vertical;
				/** 设置或检索伸缩盒对象的子元素的排列方式 **/
				-webkit-line-clamp: 1;
				/** 显示的行数 **/
			}

		}

		.sl_detail_ar {
			text {
				width: 150rpx;
				height: 50rpx;
				position: absolute;
				top: 120rpx;
				left: 320rpx;
				line-height: 50rpx;
				color: #fff;
				opacity: 0.5;
				overflow: hidden;
				word-break: break-all;
				/* break-all(允许在单词内换行。) */
				text-overflow: ellipsis;
				/* 超出部分省略号 */
				display: -webkit-box;
				/** 对象作为伸缩盒子模型显示 **/
				-webkit-box-orient: vertical;
				/** 设置或检索伸缩盒对象的子元素的排列方式 **/
				-webkit-line-clamp: 1;
				/** 显示的行数 **/

			}

			image {
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
				position: absolute;
				top: 120rpx;
				left: 250rpx;
			}

			.sl_detail_al_text {
				position: absolute;
				top: 260rpx;
				left: 300rpx;
				width: 400rpx;
				height: 60rpx;
				font-size: 10rpx;
				overflow: hidden;
				word-break: break-all;
				/* break-all(允许在单词内换行。) */
				text-overflow: ellipsis;
				/* 超出部分省略号 */
				display: -webkit-box;
				/** 对象作为伸缩盒子模型显示 **/
				-webkit-box-orient: vertical;
				/** 设置或检索伸缩盒对象的子元素的排列方式 **/
				-webkit-line-clamp: 1;
				/** 显示的行数 **/
			}
		}
	}

	.sl_gn {
		width: 605rpx;
		height: 100rpx;
		border: 1px solid #fff;
		margin-top: -50rpx;
		margin-left: 80rpx;
		border-radius: 60rpx;
		background: #fff;
		box-shadow: 0px 5px 5px #f5f5f5;

		.sl_sc {
			float: left;
			display: block;
			width: 200rpx;
			height: 50rpx;
			position: relative;
			margin-top: 20rpx;
			border-right: 1px solid #e5e5e5;

			image {
				width: 50rpx;
				height: 50rpx;
				margin: 0rpx 30rpx;
			}

			text {
				font-weight: 600;
				width: 100rpx;
				height: 40rpx;
				position: absolute;
				top: 6rpx;
				left: 80rpx;
				color: #333333;
				opacity: 0.8;
			}
		}

		.sl_pl {
			float: left;
			width: 200rpx;
			position: relative;
			height: 50rpx;
			margin-top: 20rpx;
			border-right: 1px solid #e5e5e5;

			image {
				width: 40rpx;
				height: 40rpx;
				margin: 6rpx 30rpx;
			}

			text {
				color: #333333;
				width: 100rpx;
				height: 40rpx;
				position: absolute;
				top: 6rpx;
				left: 80rpx;
				font-weight: 600;
				opacity: 0.8;
			}
		}

		.sl_fx {
			height: 50rpx;
			margin-top: 20rpx;
			float: left;
			width: 200rpx;
			position: relative;

			image {
				width: 50rpx;
				height: 50rpx;
				margin: 0rpx 30rpx;

			}

			text {
				font-weight: 600;
				color: #333333;

				width: 100rpx;
				height: 40rpx;
				position: absolute;
				top: 6rpx;
				left: 80rpx;
				opacity: 0.8;
			}
		}
	}

	.background {
		width: 750rpx;
		height: 300rpx;
		background-repeat: no-repeat;
		background-size: 80% 80%;
		position: absolute;
		background-position: center;
		filter: blur(50px);
		z-index: -1;
		transform: scale(1.5);
		background-color: #000000;
	}

	//全部播放
	.sl_all {
		width: 750rpx;
		height: 160rpx;
		background-color: #fff;
		position: relative;
		margin-top: -50rpx;
		z-index: -1;
	}

	.sl_all_image1 {
		width: 40rpx;
		height: 40rpx;
		position: absolute;
		top: 100rpx;
		left: 20rpx;
	}

	.sl_all_image2 {
		width: 40rpx;
		height: 40rpx;
		position: absolute;
		top: 100rpx;
		right: 35rpx;
	}

	.sl_all_text {
		font-weight: 600;
		width: 130rpx;
		height: 50rpx;
		position: absolute;
		top: 100rpx;
		left: 100rpx;
		letter-spacing: 1px;
		font-size: 30rpx;
	}

	.sl_nr {
		width: 750rpx;
		height: 130rpx;
		background-color: #fff;
		position: relative;
	}

	.sl_nr_text1 {
		width: 30rpx;
		height: 50rpx;
		position: absolute;
		top: 30rpx;
		left: 32rpx;
		color: #999999;

	}

	.sl_nr_text2 {
		width: 400rpx;
		height: 40rpx;
		position: absolute;
		top: 10rpx;
		left: 80rpx;
		font-weight: 600;
		overflow: hidden;
		word-break: break-all;
		/* break-all(允许在单词内换行。) */
		text-overflow: ellipsis;
		/* 超出部分省略号 */
		display: -webkit-box;
		/** 对象作为伸缩盒子模型显示 **/
		-webkit-box-orient: vertical;
		/** 设置或检索伸缩盒对象的子元素的排列方式 **/
		-webkit-line-clamp: 1;
		/** 显示的行数 **/
	}

	.sl_nr_text3 {
		width: 200rpx;
		height: 40rpx;
		position: absolute;
		top: 60rpx;
		left: 100rpx;
		color: #999999;
		font-size: 10rpx;
		overflow: hidden;
		word-break: break-all;
		/* break-all(允许在单词内换行。) */
		text-overflow: ellipsis;
		/* 超出部分省略号 */
		display: -webkit-box;
		/** 对象作为伸缩盒子模型显示 **/
		-webkit-box-orient: vertical;
		/** 设置或检索伸缩盒对象的子元素的排列方式 **/
		-webkit-line-clamp: 1;
		/** 显示的行数 **/
	}

	.sl_nr_text4 {
		width: 250rpx;
		height: 40rpx;
		position: absolute;
		top: 60rpx;
		left: 300rpx;
		color: #999999;
		font-size: 10rpx;
		overflow: hidden;
		word-break: break-all;
		/* break-all(允许在单词内换行。) */
		text-overflow: ellipsis;
		/* 超出部分省略号 */
		display: -webkit-box;
		/** 对象作为伸缩盒子模型显示 **/
		-webkit-box-orient: vertical;
		/** 设置或检索伸缩盒对象的子元素的排列方式 **/
		-webkit-line-clamp: 1;
		/** 显示的行数 **/
	}

	.sl_nr_image2 {
		width: 50rpx;
		height: 50rpx;
		position: absolute;
		top: 35rpx;
		right: 130rpx;
	}

	.sl_nr_image3 {
		width: 50rpx;
		height: 50rpx;
		position: absolute;
		top: 35rpx;
		right: 30rpx;
	}
</style>
